package pipeFilterVersion;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class Pipe {
	
	private List<Filter> filterList;
	
	public Pipe(){
		filterList=new LinkedList<Filter>();
	}
	
	public void addFilter(Filter filter){
		filterList.add(filter);
	}
	
	public void run(Lines lines){
		Iterator<Filter> itor=filterList.iterator();
		while(itor.hasNext()){
			Filter filter=itor.next();
			filter.process(lines);
		}
	}

}
